package edu.sjsu.cmpe282.api.resources;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import edu.sjsu.cmpe282.domain.Catalog;
import edu.sjsu.cmpe282.dto.CatalogDao;

@Path("/Catalog")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class CatalogResource {
	private CatalogDao catalogdao = new CatalogDao();
	
	@POST
	@Path ("/createCatalog")
	public Catalog createCatalog(Catalog catalog)throws ClassNotFoundException {
		
		System.out.print("catalog created: "+catalog.getCatalogname());
		catalogdao.createCatalog(catalog);
		return catalog;
		
	}
}
